<template>
  <div>
    <el-row :gutter="15">
      <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
        <el-col :span="14">
          <el-form-item label="用户名称" prop="userName">
            <el-input v-model="formData.userName" placeholder="邮箱或者手机号用户名称" clearable
              prefix-icon='el-icon-user-solid' :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="14">
          <el-form-item label="密码" prop="userPwd">
            <el-input v-model="formData.userPwd" placeholder="请输入密码" clearable
              prefix-icon='el-icon-user-solid' show-password :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item size="large">
            <el-button type="primary" @click="submitForm">提交</el-button>
            <el-button @click="resetForm">重置</el-button>
          </el-form-item>
        </el-col>
      </el-form>
    </el-row>
  </div>
</template>
<script>
export default {
  components: {},
  props: [],
  data() {
    return {
      formData: {
        userName: undefined,
        userPwd: undefined,
      },
      rules: {
        userName: [{
          required: true,
          message: '邮箱或者手机号用户名称',
          trigger: 'blur'
        }],
        userPwd: [{
          required: true,
          message: '请输入密码',
          trigger: 'blur'
        }],
      },
    }
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    submitForm() {
      this.$refs['elForm'].validate(valid => {
        if (!valid) return
        // TODO 提交表单
        this.axios
        .post("https://localhost:44347/api/app/p-user/list-user?userEmail="+this.formData.userName+"&userPwd="+this.formData.userPwd)
        .then(s=>{
            if(s.data==1)
            {
                alert("登录成功")
                
             
            }
            else
            {
                alert("登录失败")
            }
        })
      })
    },
    resetForm() {
      this.$refs['elForm'].resetFields()
    },
  }
}

</script>
<style>
</style>
